package com.echoesnet.echoesshortvideo.Repositories;

import com.echoesnet.echoesshortvideo.Api.HttpMethods;
import com.echoesnet.echoesshortvideo.Api.RequestHeader;
import com.echoesnet.echoesshortvideo.Constant.Api;

import java.util.Map;

import io.reactivex.Observer;

/**
 * Copyright (C) 2018 科技发展有限公司
 * 完全享有此软件的著作权，违者必究
 * 负责数据处理
 *
 * @author ben
 * @version 1.0
 * @modifier
 * @createDate 2018/4/19 18:12
 * @description
 */

public class MyVideosInfoRepository
{
    private final String TAG = MyVideosInfoRepository.class.getSimpleName();



    public void getMyVideosList(int start, int step, Observer<String> observer)
    {
        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.INDEX, start);
        reqMap.put(RequestHeader.NUM, start + step);
        reqMap.put(RequestHeader.OTHER_USER_ID, "");

        HttpMethods.getInstance().startServerRequest(observer, Api.USERC_USERVIDEOS, reqMap, true);

    }
    public void getVideosList(String uid,int start, int step, Observer<String> observer)
    {
        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.INDEX, start);
        reqMap.put(RequestHeader.NUM, start + step);
        reqMap.put(RequestHeader.OTHER_USER_ID, uid);

        HttpMethods.getInstance().startServerRequest(observer, Api.USERC_USERVIDEOS, reqMap, true);

    }
    public void checkVideo(String videoId ,Observer<String> observer)
    {
        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.VIDEO_ID, videoId);

        HttpMethods.getInstance().startServerRequest(observer, Api.VIDEOC_VIDEOSTATUS, reqMap, true);

    }


}
